package com.yjz.study.http

import com.yjz.study.http.intercept.RequestInfoInterceptor
import com.yjz.common.restful.ZRestFul
import com.yjz.study.http.intercept.HttpStatusInterceptor

/**
 *作用 :
 *作者 : yjz
 *时间 : 2025/2/11 16:40
 */
object ApiFactory {

    private const val httpBaseUrl = "http://api.devio.org/as/"

    private val zRestFul = ZRestFul(httpBaseUrl, RetrofitCallFactory(httpBaseUrl))

    init {
        zRestFul.addInterceptor(RequestInfoInterceptor())
        zRestFul.addInterceptor(HttpStatusInterceptor())
    }

    fun <T> create(service: Class<T>): T {
        return zRestFul.create(service)
    }
}